var http = require("http");
var url = require("url");

function start(router,handle){
      function onRequest(req,res){
        var pathname = url.parse(req.url).pathname;
        console.log("Request for"+pathname+"received");
        router(handle, pathname, res, req);
   }

   http.createServer(onRequest).listen(8888);
   console.log("Server has started");
}



/*
module.exports = {
  start:start
};
*/
exports.start = start;